<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c"%>
<%@ taglib uri="/WEB-INF/tld/struts-bean.tld" prefix="bean"%>

<div id="name">
   <h2 title="Name"><c:out value="${ActionsForm.user.firstName}"/> <c:out value="${ActionsForm.user.lastName}"/></h2>
   <a href="<bean:message key="app.action.attack.user" arg0="${ActionsForm.user.id}" />">
		<img src="../images/btn_attack.png" style="border:none;">
   </a>
</div>

<div id="status">
   <c:out value="${ActionsForm.comment}"/>
</div>

<c:forEach var="action" items="${ActionsForm.actionList}">
   <hr />
   <c:if test="${action.attack}">
	   <div id="main-entry">
	      <div id="war-entry">
	         <span class="attack">
	         	<div class="img-div">
	         		<img src="<c:out value="${action.userAttack.image}"/>" />
	         	</div>
	         </span>
	         <span class="reason">
	            <div class="action">
	               <a href="<bean:message key="app.baseUrl" /><bean:message key="app.profile.permalink" /><c:out value="${action.userAttack.id}"/>"><c:out value="${action.userAttack.firstName}"/></a> atacou <a href="<bean:message key="app.baseUrl" /><bean:message key="app.profile.permalink" /><c:out value="${action.userDefend.id}"/>"><c:out value="${action.userDefend.firstName}"/></a> dizendo:
	            </div>
	            <div class="description"><bean:write name="action" property="comment"/></div>
	         </span>
	         <span class="defend">
	         	<div class="img-div">
	         		<img src="<c:out value="${action.userDefend.image}"/>" />
	         	</div>
	         </span>
	      </div>
	      
	      
	      <div id="allies-entry-<c:out value="${action.id}"/>" class="allies-entry">
	         <span class="attack-allies"><strong><bean:write name="action" property="allyAttack"/> aliados</strong> | <a href="<bean:message key="app.action.support" arg0="${action.id}" />">Apoiar <c:out value="${action.userAttack.firstName}"/></a></span>
	         <span class="defend-allies"><a href="<bean:message key="app.action.defend" arg0="${action.id}" />">Defender <c:out value="${action.userDefend.firstName}"/></a> | <strong><bean:write name="action" property="allyDefend"/> aliados</strong></span>
	      </div>
	      
	      <div id="attacks-entry-<c:out value="${action.id}"/>" class="attacks-entry">
	         <div class="comments">
	            <a href="#"><bean:write name="action" property="countSubAction"/> coment&aacute;rios</a> | 
	            <a href="#">Ver tudo</a>
	         </div>
	         
	         <c:forEach var="subAction" items="${action.subActionList}">
	            <div class="<c:if test="${subAction.attack}">attack</c:if><c:if test="${!subAction.attack}">defend</c:if>">
		            <img src="<c:out value="${subAction.user.image}"/>"/>
		               <div id="attacks-list-<c:out value="${action.id}"/>">
		                  <a href="<bean:message key="app.baseUrl" /><bean:message key="app.profile.permalink" /><c:out value="${subAction.user.id}"/>"><c:out value="${subAction.user.firstName}"/></a>: <bean:write name="subAction" property="comment"/>
		                  <br/>
		                  <span class="enemy-links">
		                     <a href="javascript:attack(${subAction.id},'attacks-list-${action.id}');" >Atacar</a>
		                  </span>
		               </div>
		         </div>
	         </c:forEach>
	      </div>
	   </div>
   </c:if>
   <c:if test="${!action.attack}">
   <div id="main-entry">
	   <div id="action-entry-<c:out value="${action.id}"/>">
	   		<span class="me">
	   			<div class="img-div">
	      			<img src="<c:out value="${action.userAttack.image}"/>" />
	      		</div>
	      	</span>
	      <span class="my-action">
	            <div class="highlight"><a href="<bean:message key="app.baseUrl" /><bean:message key="app.profile.permalink" /><c:out value="${action.userAttack.id}"/>"><c:out value="${action.userAttack.firstName}"/></a> disse:</div><bean:write name="action" property="comment"/>
	      </span>
	      <span class="enemy-links">
	                  <a href="javascript:attack(${action.id},'action-entry-${action.id}');" >Atacar</a>
	      </span>
	   </div>
   </c:if>
</c:forEach>